﻿namespace Bowling
{

    public class Frame
    {
        public Frame()
        {
            Score = new FrameScore();    
        }
        
        public int Roll1BallIndex { get; set; }
        public int FrameNumber { get; set; }

        public FrameScore Score { get; set; }

        public int Roll1 { get; set; }
        public int? Roll2 { get; set; }
        public int? Bonus { get; set; }

        // can I creat a strikeFrame : Frame? (then I would need a LastStrikeFrame, LastSpareFrame etc?) 
        // I think that would avoid if statements and simplify logic?
        
        public bool IsStrike
        {
            get { return Roll1 == 10;  }
        }

        // can I create a LastFrame : Frame ?
        public bool LastFrame
        {
            get { return FrameNumber == 9; }
        }

        // can I create a SpareFrame : Frame ?
        public bool IsSpare
        {
            get { return (Roll1 != 10 && (Roll1 + Roll2 == 10)); }
        }

    }
}